﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace BBECServiceBusAdapter.ConstituentDataContractExtensions
{
    #region Supporting Collection Classes


    [DataContract(Namespace = Helper.Namespace)]
    public enum ActionType
    {
        [EnumMember]
        Add,
        [EnumMember]
        Update,
        [EnumMember]
        Delete,
        [EnumMember]
        None
    }


    [DataContract(Namespace = Helper.Namespace)]
    public class ConstituentNotesData : ContractBase
    {
        [DataMember(IsRequired = false)]
        public DateTime DateEntered;
        [DataMember(IsRequired = false)]
        public DateTime LastUpdated; 
        [DataMember(IsRequired = false)]
        public string NoteType = "";
        [DataMember(IsRequired = false)]
        public string NoteText = "";



        [DataMember(IsRequired = false)]
        public string ChangedBy = "";
        [DataMember(IsRequired = false)]
        public string AddedBy = "";
        [DataMember(IsRequired = false)]
        public string Title = "";
        [DataMember(IsRequired = false)]
        public string Author = "";
   
    }

    [DataContract(Namespace = Helper.Namespace)]
    public class ConstituentInterestsData : ContractBase
    {
        [DataMember(IsRequired = false)]
        public string InterestCode = "";
        [DataMember(IsRequired = false)]
        public string NoteText = "";
        [DataMember(IsRequired = false)]
        public string AddedBy = "";
        [DataMember(IsRequired = false)]
        public string ChangedBy = "";
    }

    
    
    [DataContract(Namespace=Helper.Namespace)]
    public class AlternateIDData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string AlternateIDType = "";
        [DataMember(IsRequired = true)]
        public string AlternateID = "";
    }

    [DataContract(Namespace=Helper.Namespace)]
    public class ConstituencyData:ContractBase
    {

        [DataMember(IsRequired = false)]
        public DateTime? StartDate;
        [DataMember(IsRequired = false)]
        public DateTime? EndDate;
        [DataMember(IsRequired = true)]
        public string Constituency = "";

        /*
        ATTRIBUTES
        [DataMember(IsRequired = true)]
        public Boolean? IsPrimary;
        */

        //[DataMember(IsRequired = true)]
        //public string ClassCode = "";
        //Status = Active or Inactive 
    }


    /*
    [DataContract(Namespace=Helper.Namespace)]
    public class SolicitCodeData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string SolicitType = "";
        [DataMember(IsRequired = false)]
        public string SolicitComment = "";
    }
    */


    [DataContract(Namespace=Helper.Namespace)]
    public  class CommunicationPreferenceData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string CommunicationPreferenceType = "";
        [DataMember(IsRequired = false)]
        public string CommunicationSendBy = "";
        [DataMember(IsRequired = false)]
        public string CommunicationAddressType = "";
    }
    [DataContract(Namespace=Helper.Namespace)]
    public class NameFormatData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string NameFormatType = "";
        [DataMember(IsRequired = true)]
        public string NameFormat = "";
    }


    [DataContract(Namespace=Helper.Namespace)]
    public class RelationshipData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string RelationshipType = "";
        [DataMember(IsRequired = true)]
        public string RelationshipId = "";
        [DataMember(IsRequired = false)]
        public DateTime? StartDate;
        [DataMember(IsRequired = false)]
        public DateTime? EndDate;
        [DataMember(IsRequired = false)]
        public String Direction = "";
        [DataMember(IsRequired = true)]
        public string LastOrOrganizationName = "";

        //[DataMember(IsRequired = true)]
        //public ConstituentDataContract RelatedConstituent;
        //[DataMember(IsRequired = false)]
        //public bool IsSpouse = false;
    }




    [DataContract(Namespace=Helper.Namespace)]
    public class AddressData:ContractBase
    {
        [DataMember(IsRequired = false)]
        public string AddressBlock = "";
        [DataMember(IsRequired = false)]
        public string City = "";
        [DataMember(IsRequired = false)]
        public string State = "";
        [DataMember(IsRequired = false)]
        public string PostalCode = "";
        [DataMember(IsRequired = false)]
        public string Country = "United States";
        [DataMember(IsRequired = false)]
        public string County = "";
        [DataMember(IsRequired = false)]
        public string AddressType = "";
        [DataMember(IsRequired = false)]
        public bool IsPrimary = false;
        [DataMember(IsRequired = false)]
        public bool DoNotMail = false;
        [DataMember(IsRequired = false)]
        public DateTime? StartDate;
        [DataMember(IsRequired = false)]
        public DateTime? EndDate; 

    }


    [DataContract(Namespace=Helper.Namespace)]
    public class PhoneData:ContractBase
    {
        [DataMember(IsRequired = true)]
        public string PhoneNumber = "";
        [DataMember(IsRequired = false)]
        public string PhoneType = "";
        [DataMember(IsRequired = false)]
        public bool IsPrimary = false;
        [DataMember(IsRequired = false)]
        public bool DoNotCall = false;
    }

    [DataContract(Namespace=Helper.Namespace)]
    public class EmailData:ContractBase
    {
        [DataMember(IsRequired = false)]
        public string EmailAddress = "";
        [DataMember(IsRequired = false)]
        public string EmailAddressType = "";
        [DataMember(IsRequired = false)]
        public bool IsPrimary = false;
        [DataMember(IsRequired = false)]
        public bool DoNotEmail = false;
    }


    [DataContract(Namespace = Helper.Namespace)]
    public class Interaction : ContractBase
    {
        [DataMember(IsRequired = false)]
        public string ProspectPlan = "";
        [DataMember(IsRequired = false)]
        public string FundraiserID = "";
        [DataMember(IsRequired = false)]
        public string Objective = "";

        [DataMember(IsRequired = false)]
        public string InteractionType = "";
        [DataMember(IsRequired = false)]
        public string InteractionSubType = "";
        [DataMember(IsRequired = false)]
        public string Comment = ""; 




        [DataMember(IsRequired = false)]
        public string ProspectPlanStatusCode = "";

        [DataMember(IsRequired = false)]
        public DateTime? InteractionDate;
        [DataMember(IsRequired = false)]
        public DateTime? ExpectedDate;
        [DataMember(IsRequired = false)]
        public DateTime? ActualDate;
    }

    [DataContract(Namespace = Helper.Namespace)]
    public class DonorRepAssignment : ContractBase
    {

        [DataMember(IsRequired = false)]
        public string FundraiserID = "";
        [DataMember(IsRequired = false)]
        public string FundraiserLastName = "";
        [DataMember(IsRequired = false)]
        public DateTime? StartDate;
        [DataMember(IsRequired = false)]
        public DateTime? EndDate;
        [DataMember(IsRequired = false)]
        public string ProspectTeamRole = "";
    }


    [DataContract(Namespace = Helper.Namespace)]
    public sealed class PledgeDataContract : ContractBase
    {

        [DataMember(IsRequired = false)]
        public string DesignationName = "";
        [DataMember(IsRequired = false)]
        public DateTime? Date;
        [DataMember(IsRequired = false)]
        public DateTime? PostDate;
        [DataMember(IsRequired = false)]
        public Decimal Amount;
        [DataMember(IsRequired = false)]
        public string Description = "";
        [DataMember(IsRequired = false)]
        public string TransactionType = "";
        [DataMember(IsRequired = false)]
        public string Application = "";
        [DataMember(IsRequired = false)]
        public string Type = "";

    }

    [DataContract(Namespace = Helper.Namespace)]
    public sealed class PaymentDataContract : ContractBase
    {

        [DataMember(IsRequired = false)]
        public string ParentRevenueID = "";
        [DataMember(IsRequired = false)]
        public DateTime RevenueDate;
        [DataMember(IsRequired = false)]
        public DateTime PostDate;
        [DataMember(IsRequired = false)]
        public decimal Amount = 0;
        [DataMember(IsRequired = false)]
        public String Description;
        [DataMember(IsRequired = false)]
        public String Designation;
        [DataMember(IsRequired = false)]

        public String SubDesignation;
        [DataMember(IsRequired = false)]
        public DateTime? ReceiptDate;
        //[DataMember(IsRequired = false)]
        //public ReceiptNumber int
        [DataMember(IsRequired = false)]
        public String PaymentMethod;
        [DataMember(IsRequired = false)]
        public String InboundChannel;
        [DataMember(IsRequired = false)]
        public Boolean IsReversal;
        //[DataMember(IsRequired = false)]
        //public String PledgeID;
        
        
        //[DataMember(IsRequired = false)]
        //public RevenueDataContractExtensions.RevenuePaymentMethod PaymentMethod = RevenueDataContractExtensions.RevenuePaymentMethod.None;
        //[DataMember(IsRequired = false)]
        //public RevenueDataContractExtensions.RevenueTransactionType TransactionType = RevenueDataContractExtensions.RevenueTransactionType.Payment;
        //[DataMember(IsRequired = false)]
        //public string CheckNumber = "";
        //[DataMember(IsRequired = false)]
        //public string CreditCardLastFourDigits = "";
        //[DataMember(IsRequired = false)]
        //public DateTime? CreditCardExpirationDate;
        //[DataMember(IsRequired = false)]
        //public string CreditCardType = "";     // this is configurable so we can't make it an enum
        //[DataMember(IsRequired = false)]
        //public string Appeal = "";
        //[DataMember(IsRequired = false)]
        //public List<RevenueDataContractExtensions.RevenueSplit> RevenueSplits;
    }

  /*
    [DataContract(Namespace = Helper.Namespace)]
    public sealed class DonorRepAssignment : ContractBase
    {
        [DataMember(IsRequired = false)]
        public string ConstituencyCodeID = "";
        [DataMember(IsRequired = false)]
        public DateTime DateFrom;
        [DataMember(IsRequired = false)]
        public DateTime DateTo;
        [DataMember(IsRequired = false)]
        public string FundraiserID = "";
        [DataMember(IsRequired = false)]
        public string FundraiserLastName = "";

    }
    */


    [DataContract(Namespace = Helper.Namespace)]
    public class SolicitCodeData : ContractBase
    {
        [DataMember(IsRequired = true)]
        public string SolicitCode = "";
        [DataMember(IsRequired = false)]
        public DateTime? StartDate;
        [DataMember(IsRequired = false)]
        public DateTime? EndDate;
        [DataMember(IsRequired = true)]
        public string Comments = "";

    }




    #endregion

    #region Enumerations

    [DataContract(Namespace=Helper.Namespace)]
    public enum ConstituentType
    {
        [EnumMember]
        Individual,
        [EnumMember]
        Organization,
        [EnumMember]
        Group,
        [EnumMember]
        Household,
        [EnumMember]
        Fundraiser
    }

    [DataContract(Namespace=Helper.Namespace)]
    public enum ConstituentGenderType
    {
        [EnumMember]
        Male,
        [EnumMember]
        Female,
        [EnumMember]
        Unknown
    
    }


    #endregion
}
